﻿////////////////////////////////////////////////////////////////////////
//Autor: Gabriel Tame Borao  - gabrieltame@yahoo.es 
//Fecha: 2010/09/15 01:26
//Solucion: GTameReport.sln
//Proyecto: GTameReport
//Fichero: DataGroupingType.cs
//
//	Copyright (C) 2010  Gabriel Tame Borao (GTB)
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.
////////////////////////////////////////////////////////////////////////
namespace GTameReport
{
    using Rdl;
    using System;
    using System.Collections;

    public class DataGroupingType
    {
        private GTameReport.CustomPropertiesType _CustomProperties;
        private GTameReport.DataGroupingsType _DataGroupings;
        private GTameReport.GroupingType _Grouping;
        private GTameReport.SortingType _Sorting;
        private bool? _Static = null;
        private bool? _Subtotal = null;

        public Rdl.DataGroupingType Write()
        {
            Rdl.DataGroupingType type = new Rdl.DataGroupingType();
            ArrayList list = new ArrayList();
            ArrayList list2 = new ArrayList();
            if (this._CustomProperties != null)
            {
                list.Add(this._CustomProperties.Write());
                list2.Add(ItemsChoiceType28.CustomProperties);
            }
            if (this._DataGroupings != null)
            {
                list.Add(this._DataGroupings.Write());
                list2.Add(ItemsChoiceType28.DataGroupings);
            }
            if (this._Grouping != null)
            {
                list.Add(this._Grouping.Write());
                list2.Add(ItemsChoiceType28.Grouping);
            }
            if (this._Sorting != null)
            {
                list.Add(this._Sorting.Write());
                list2.Add(ItemsChoiceType28.Sorting);
            }
            if (this._Static.HasValue)
            {
                list.Add(this._Static);
                list2.Add(ItemsChoiceType28.Static);
            }
            if (this._Subtotal.HasValue)
            {
                list.Add(this._Subtotal);
                list2.Add(ItemsChoiceType28.Subtotal);
            }
            type.Items = list.ToArray();
            type.ItemsElementName = (ItemsChoiceType28[]) list2.ToArray(typeof(ItemsChoiceType28));
            list2 = null;
            list = null;
            return type;
        }

        public GTameReport.CustomPropertiesType CustomProperties
        {
            get
            {
                if (this._CustomProperties == null)
                {
                    this._CustomProperties = new GTameReport.CustomPropertiesType();
                }
                return this._CustomProperties;
            }
            set
            {
                this._CustomProperties = value;
            }
        }

        public GTameReport.DataGroupingsType DataGroupings
        {
            get
            {
                if (this._DataGroupings == null)
                {
                    this._DataGroupings = new GTameReport.DataGroupingsType();
                }
                return this._DataGroupings;
            }
            set
            {
                this._DataGroupings = value;
            }
        }

        public GTameReport.GroupingType Grouping
        {
            get
            {
                if (this._Grouping == null)
                {
                    this._Grouping = new GTameReport.GroupingType();
                }
                return this._Grouping;
            }
            set
            {
                this._Grouping = value;
            }
        }

        public GTameReport.SortingType Sorting
        {
            get
            {
                if (this._Sorting == null)
                {
                    this._Sorting = new GTameReport.SortingType();
                }
                return this._Sorting;
            }
            set
            {
                this._Sorting = value;
            }
        }

        public bool? Static
        {
            get
            {
                return this._Static;
            }
            set
            {
                this._Static = value;
            }
        }

        public bool? Subtotal
        {
            get
            {
                return this._Subtotal;
            }
            set
            {
                this._Subtotal = value;
            }
        }
    }
}

